package 力扣._00周赛._145双周赛.问题1;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

class Solution {
    public int minOperations(int[] nums, int k) {
        Set<Integer> set = new HashSet<>();
        for (int num : nums) {
            if (num > k)
                set.add(num);
            else if (num < k) {
                return -1;
            }
        }

        return set.size();
    }
}